package com.cy.pj.activity.dao;

import com.cy.pj.activity.pojo.Activity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ActivityDao {
    @Select("select * from tb_activity")
    List<Activity> findAll();

    @Insert("insert into tb_activity (title,category,startTime,endTime,remark,state,createdUser,createdTime) values(#{title},#{category},#{startTime},#{endTime},\n" +
            "          #{remark},#{state},#{createdUser},now())")
    void insert(Activity activity);
}
